<script setup lang="ts">
/* ref获取DOM对象 */
import {ref} from "vue";

const buttonRef = ref<HTMLButtonElement | null>(null)
console.log(buttonRef?.value?.innerHTML)
</script>

<template>
  <div>
    <button ref="buttonRef">点我</button>
  </div>
</template>

